UnitAdapter = function(options){
	var _options = {};
	$.extend(_options,this._options,options);
	$.extend(this,{
		_options:_options
	});
	this._init();
};

UnitAdapter.prototype = {
		_options:{
			dom:null,
			velocity:1,
			a:0.001,
			direction:0
		},
		_dom:null,
		_unit:null,
		_init:function(){
			this._dom = this._options.dom;
			this._unit = new Unit({
				velocity:this._options.velocity,
				a:this._options.a,
				direction:this._options.direction,
				x:Utils.pixel.number(this._dom.style.left),
				y:Utils.pixel.number(this._dom.style.top)
			});
		},
		move:function(){
			this._unit.move();
			this._dom.style.top = Utils.pixel.style(this._unit.y);
			this._dom.style.left = Utils.pixel.style(this._unit.x);
		}
};
Unit = function(options){
	$.extend(this,options);
	this._init();
};
Unit.prototype = {
		//速度
		velocity:0,
		//X轴速度
		vx:0,
		//Y轴速度
		vy:0,
		//角速度
		vr:0,
		//加速度
		a:0,
		//角加速度
		ar:0,
		//X轴加速度
		ax:0,
		//Y轴加速度
		ay:0,
		//重力加速度
		ag:0,
		//方向
		direction:0,
		//Y向量
		dy:0,
		//X向量
		dx:0,
		//X坐标
		x:0,
		//Y坐标
		y:0,
		//宽度
		width:0,
		//高度
		height:0,
		move:function(){
			this.vx += this.ax;
			this.vy += this.ay + this.ag;
			
			this.x +=this.vx;
			this.y +=this.vy;  
		},
		_init:function(){
			this.dx = Math.cos(Utils.math.radians(this.direction));
			this.dy = Math.sin(Utils.math.radians(this.direction));

			//分解加速度
			this.ax = this.dx * this.a;
			this.ay = this.dy * this.a;
			
			//分解速度
			this.vx = this.dx * this.velocity;
			this.vy = this.dy * this.velocity;
		}
};
Point = {
	x:0,
	y:0
};
Ellipse = {
	cx:0,
	cy:0,
	rx:0,
	ry:0
};

Rect = {
	x:0,
	y:0,
	width:0,
	height:0
};

Circle = {
	cx:0,
	cy:0,
	r:0
};

Line = {
	x1:0,
	y1:0,
	x2:0,
	y2:0
};

Polyline = {
	points:[]
};

Polygon = {
	points:[]
};
Direct = {
	tag:"",
	points:[],
	cmd:function(){
		
	}
};
Path = {
	directs:[]
};